import React, {useState,useEffect,useContext} from 'react';

import {ThemeContext} from './createContext';

const View = (props)=>{

    const themes = useContext(ThemeContext);

    console.log(themes)
    // []
    return(
        <div className="m">
            这是child
            <h3>{themes.foreground}</h3>
            {props.children}
            <ThemeContext.Consumer>
                {(themes)=>(
                    <div>{themes.foreground}</div>
                )}
            </ThemeContext.Consumer>
        </div>
    )
}
export default View;
